package com.link510.aitools.core.data.restapi;

import com.link510.aitools.core.data.model.QiniuFileListingModel;
import com.link510.aitools.core.message.MessageInfo;

import io.reactivex.Observable;
import retrofit2.http.GET;
import retrofit2.http.Query;

/**
 * 设备服务服务
 *
 * @author cqnews
 */
public interface AirobotService {

    //region 核心板

//    /**
//     * 修改设备编号
//     *
//     * @param deviceSN 设备编号
//     * @param token    设备token
//     */
//    @GET("robot/edit/token")
//    Observable<MessageInfo<String>> editToken(@Query(value = "deviceSN") String deviceSN,
//                                              @Query(value = "token") String token);


    /**
     * 修改设备编号
     *
     * @param deviceSN 设备编号
     * @param name     设备名称
     */
    @GET("robot/edit/name")
    Observable<MessageInfo<String>> editName(@Query(value = "deviceSN") String deviceSN,
                                             @Query(value = "name") String name);

    /**
     * 修改设备编号
     *
     * @param deviceSN 设备编号
     * @param ip       设备IP
     * @param port     设备端口
     */
    @GET("robot/edit/ip")
    Observable<MessageInfo<String>> editIpAndPort(@Query(value = "deviceSN") String deviceSN,
                                                  @Query(value = "ip") String ip,
                                                  @Query(value = "port") Integer port);


    /**
     * 固件更新
     *
     * @param deviceSN 设备编号
     * @param httpUrl  固件地址
     */
    @GET("robot/upgrade/send")
    Observable<MessageInfo<String>> coreUpgradeSend(@Query(value = "deviceSN") String deviceSN,
                                                    @Query(value = "httpUrl") String httpUrl);

    /**
     * 日志收集
     *
     * @param deviceSN 设备编号
     * @return Observable<MessageInfo<String>>
     */
    @GET("robot/logs/get")
    Observable<MessageInfo<String>> logsGet(@Query(value = "deviceSN") String deviceSN);

    /**
     * 重启设备
     *
     * @param deviceSN 设备编号
     */
    @GET("robot/reboot")
    Observable<MessageInfo<String>> reboot(@Query(value = "deviceSN") String deviceSN);


    //endregion

    //region LED


    /**
     * 修改LED文本
     *
     * @return 设备数据
     */

    @GET("robot/led/text")
    Observable<MessageInfo<String>> ledEditText(@Query(value = "deviceSN") String deviceSN,
                                                @Query(value = "text") String text);


    //endregion

    //region 图片

    /**
     * 获取图片
     *
     * @param deviceSN 设备编号
     * @param time     时间戳
     * @param marker   maker
     * @param limit    长度
     * @return Observable<MessageInfo < QiniuFileListingModel>>
     */
    @GET("robot/picture/list")
    Observable<MessageInfo<QiniuFileListingModel>> pictureList(@Query(value = "deviceSN") String deviceSN,
                                                               @Query(value = "time") Integer time,
                                                               @Query(value = "marker") String marker,
                                                               @Query(value = "limit") Integer limit);

    /**
     * 获取图片
     *
     * @param bucket 空间
     * @return Observable<MessageInfo < QiniuFileListingModel>>
     */
    @GET("robot/upload/token")
    Observable<MessageInfo<String>> getUploadToken(@Query(value = "bucket") String bucket);


    //endregion


    //region 音频

    /**
     * 音频下发中
     *
     * @param httpUrl mp3URL地址
     */
    @GET("robot/audio/send")
    Observable<MessageInfo<String>> audioEditUrl(@Query(value = "deviceSN") String deviceSN,
                                                 @Query(value = "httpUrl") String httpUrl);


    /**
     * 音频音量大小调整
     *
     * @param volume 音量大小
     */
    @GET("robot/audio/volume")
    Observable<MessageInfo<String>> audioEditVolume(@Query(value = "deviceSN") String deviceSN,
                                                    @Query(value = "volume") Integer volume);

    /**
     * 远程喊话
     *
     * @param deviceSN 设备编码
     * @param mp3Url   mp3地址
     */
    @GET("robot/audio/shouting")
    Observable<MessageInfo<String>> audioShoutingUrl(@Query(value = "deviceSN") String deviceSN,
                                                     @Query(value = "httpUrl") String mp3Url);


    //endregion
}
